package com.bjpowernode.springboot.controller;

import com.bjpowernode.springboot.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RedisController {

    @Autowired
    private RedisService redisService;

    @RequestMapping(value = "/put")
    public @ResponseBody String redis(String key,String value){
        redisService.put(key,value);
        return "数据存入成功";
    }

    @RequestMapping(value = "/get")
    public @ResponseBody String get(String key){
        String s = redisService.get(key);
        return s;
    }
}
